<!--右侧内容开始-->
<div class="fadeIn">
    <br />
    <ol class="breadcrumb">
        <li class="active"><span class="glyphicon glyphicon-home" style="color:#23527c"></span>&nbsp;<mainpage></mainpage>
        </li>
        <li class="active">运维工作台 / 参数配置管理 / 接口参数管理 / 通道参数管理</li>
    </ol>
    <div class="rightbar">
        <div id="serviceEnd" class="showEle sign1">
            <form action="gateDef/out-excel" method="post" id="form">
                <div class="left marT15 marR10">
                    <span class="search-name">短信通道</span>
                    <select class="form-control1 svrNodeName" ng-model="searchData.gateLinkId" name="gateLinkId">
                        <option value="">全部</option>
                        <option value={{row.GATE_LINK_ID}} ng-repeat="row in showData">{{row.GATE_LINK_NAME}}</option>
                    </select>

                </div>
                <div class="left marR10 marT15">
                    <span class="search-name">状态</span>
                    <select class="form-control1" ng-model="searchData.status" name="status">
                        <option value=''>全部</option>
                        <option value='1'>有效</option>
                        <option value='0'>无效</option>
                    </select>
                </div>
            </form>
            <a href="javascript:;" class=" btn btn-primary btn-sm left marT15" id="search" ng-click='search()'><span
                    class="glyphicon glyphicon-search"></span></a>
            <div class="right marT15" style="position:relative">
                <button class="btn btn-primary btn-sm" ng-click='outExcel()'><img style="width:25px; height:20px;" src="img/excel.png">导出表格<span
                        ng-style='loadStyle' class="outExcelLoad"><img src="img/load.gif"></span>
                </button>
            </div>

            <div class="table-box">
                <table class="table table-bordered table-striped text-center bg-info marT15">
                    <thead>
                        <tr class="info">
                            <th class="text-center">序号</th>
                            <th class="text-center">短信通道ID</th>
                            <th class="text-center">短信通道名称</th>
                            <th class="text-center">归属运营商</th>
                            <th class="text-center">特服号码</th>
                            <th class="text-center">企业代码</th>
                            <!--  <th class="text-center">网关速率（条/秒）</th> -->
                            <th class="text-center">并发连接数（条）</th>
                            <th class="text-center">状态</th>
                            <th class="text-center">说明</th>
                            <th class="text-center">操作</th>
                        </tr>
                    </thead>
                    <tbody id="appList">
                        <tr ng-repeat="Item in result">
                            <td>{{ $index+1 }}</td>
                            <td class="w115">{{ Item.gateLinkId }}</td>
                            <td class="w115">{{ Item.gateLinkName }}</td>
                            <td class="w115">{{ Item.mobileCorpName }}</td>
                            <td class="w85">{{ Item.spNumber }}</td>
                            <td class="w85">{{ Item.corpId }}</td>
                            <!--   <td></td> -->
                            <td class='w115'>{{ Item.linkNum }}</td>
                            <td class="w85">
                                <span ng-if='"1"==Item.status'>有效</span>
                                <span ng-if='"0"==Item.status'>无效</span>
                            </td>
                            <td style="min-width: 200px; word-break: break-all;">{{ Item.desc }}</td>
                            <td style="min-width: 260px;">
                                <a class="marR10" ng-click='changeStstus($index,Item.gateLinkId,Item.status)' ng-show="'0'===Item.status">生效</a>
                                <a class="marR10" ng-click='changeStstus($index,Item.gateLinkId,Item.status)' ng-show="'1'===Item.status">失效</a>
                                <a class="marR10" data-toggle="modal" data-target="#sendRule" ng-click="sendingRule(Item.gateLinkId)">发送规则</a>
                                <a class="marR10" data-toggle="modal" data-target="#routerSettings" ng-click="routeLink(Item.gateLinkId)">路由设置</a>
                                <a class="marR10" data-toggle="modal" data-target="#add" ng-click="editTr('修改',Item.gateLinkId)">修改</a>
                                <a class="" data-toggle="modal" data-target="#delete" ng-click="delete(Item.gateLinkId,$index)">删除</a>
                            </td>

                        </tr>

                    </tbody>
                    <tfoot>
                        <tr>
                            <td><a class="glyphicon glyphicon-plus" data-toggle="modal" data-target="#add" ng-click="editTr('添加')"></a>
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                    </tfoot>

                </table>
            </div>
            <page></page>
        </div>
    </div>
</div>
<!--右侧内容结束-->
</div>


<!-- 添加程序弹框开始 -->
<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="add">
    <div class="modal-dialog" role="document">
        <div class="modal-content" style="width:620px">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="">{{popup}}通道参数</h4>
            </div>
            <div class="modal-body">
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>短信通道名称</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.gateLinkName" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>特服号码</span></label>
                        <input type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" class="form-control line4 right spNumber"
                            ng-model="addData.spNumber" />
                    </span>
                </div>

                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>企业号码</span></label>
                        <input type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" oninput="if(value.length>6)value=value.slice(0,6)"
                            class="form-control line4 right corpId" ng-model="addData.corpId" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>最大连接数</span></label>
                        <input type="number" oninput="if(value.length>9)value=value.slice(0,9)" class="form-control line4 right"
                            ng-model="addData.linkNum" />条
                    </span>
                </div>
                <div class="row marB15">
                    <!--  <span class="col-xs-6">
                   <label class="left"><span>连接速率(条/秒)</span></label>
                    <input type="number" class="form-control line4 right" ng-model="addData."/>
               </span> -->
                    <div class="col-xs-6">
                        <label class="left"><span>状态通道</span></label>
                        <select class="form-control line4 right" ng-model="addData.status">
                            <option value="1">有效</option>
                            <option value="0">失效</option>
                        </select>
                    </div>
                    <span class="col-xs-6">
                        <label class="left"><span>短信签名</span></label>
                        <select class="form-control line4 right" ng-model="addData.signType">
                            <option value="0">不签名</option>
                            <option value="1">短信前面签名</option>
                            <option value="2">短信后面签名</option>
                        </select>
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>专线IP</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.specialIp" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>专线端口</span></label>
                        <input type="text" class="form-control line4 right" onkeyup="this.value=this.value.replace(/\D/g,'')"
                            oninput="if(value.length>9)value=value.slice(0,9)" ng-model="addData.specialPort" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>专线登陆用户</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.specialLoginUser" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>专线登陆密码</span></label>
                        <input type="text" class="form-control line4 right" oninput="if(value.length>128)value=value.slice(0,128)"
                            ng-model="addData.specialLoginPwd" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>互联网IP</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.internetIp" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>互联网端口</span></label>
                        <input type="number" class="form-control line4 right" onkeyup="this.value=this.value.replace(/\D/g,'')"
                            ng-model="addData.internetPort" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>互联网用户登陆</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.internetLoginUser" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>互联网登陆密码</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.internetLoginPwd" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>短信平台IP</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.serverIp" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>短信平台服务端口</span></label>
                        <input type="number" class="form-control line4 right" onkeyup="this.value=this.value.replace(/\D/g,'')"
                            ng-model="addData.serverPort" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>短信平台登陆用户</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.loginUser" />
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>短信平台登陆密码</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.loginPwd" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-6">
                        <label class="left"><span>归属运营商</span></label>
                        <select class="form-control line4 right" ng-model="addData.mobileCorp" name="">
                            <option value="">全部</option>
                            <option value={{row.DICVALUE}} ng-repeat="row in mobileCorpData">{{row.DICVALUENAME}}</option>
                        </select>
                    </span>
                    <span class="col-xs-6">
                        <label class="left"><span>最大速率(单位:条/秒)</span></label>
                        <input type="text" class="form-control line4 right" ng-model="addData.maxFlow" placeholder="0 ~ 5000范围内的整数" />
                    </span>
                </div>
                <div class="row marB15">
                    <span class="col-xs-12">
                        <label class="left"><span>通道说明</span></label>
                        <textarea class="form-control right" ng-model="addData.desc" id="desc"></textarea>
                    </span>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary btn-sm" ng-click='editSave()'>保存</button>
            </div>
        </div>
    </div>
</div>
<!-- 添加程序结束 -->

<!--修改程序结束-->
<!-- 提示框 -->
<div class="modal fade" id="delete">
    <div class="modal-dialog">
        <div class="modal-content message_align">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 class="modal-title">提示信息</h4>
            </div>
            <div class="modal-body">
                <p>您确认删除吗？</p>
            </div>
            <div class="modal-footer">
                <input type="hidden" id="url" />
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <!-- <a  onclick="urlSubmit()" class="btn btn-primary" data-dismiss="modal">确定</a> -->
                <a class="btn btn-primary" data-dismiss="modal" ng-click='deleteTr()'>确定</a>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- 提示框结束 -->
<!-- 发送规则弹窗 -->
<div class="modal fade" id="sendRule" tabindex="-1" role="dialog" aria-labelledby="smsSettings">
    <div class="modal-dialog" role="document">
        <form name="smsForm">
            <div class="modal-content">
                <div class="modal-header" style='height:52px;'>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body">
                    <fieldset style="border-bottom: 1px solid #e5e5e5;">
                        <legend style="margin: 20px 0px;">可发送运营商</legend>
                        <span id="mobileCorp" class="">
                            <!--<label id="mobileCorp"></label>-->
                        </span>
                    </fieldset>

                    <fieldset style="border-bottom: 1px solid #e5e5e5;">
                        <legend style="margin: 20px 0px;">可发送省份</legend>
                        <div class="setOptionAll" style="border-bottom: 1px solid #e5e5e5;margin-bottom:2px;">
                            <input id="checkAll" name="setOption" class="  " type="radio" value="1">全选
                            <input id="theProvince" name="setOption" class="  " type="radio" value="1">本省
                            <input id="otherProvinces" name="setOption" class="  " type="radio" value="1">外省
                        </div>
                        <span id="provinceAll" class="">
                            <!--<label id="provinceAll"></label>-->
                        </span>
                    </fieldset>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary btn-sm" ng-click="setSave()">保存</button>
                </div>
            </div>
        </form>
    </div>
</div>
<!--路由设置弹窗-->
<div class="modal fade" id="routerSettings" tabindex="-1" role="dialog" aria-labelledby="routerSettings">
    <div class="modal-dialog" role="document">
        <form name="routerForm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">请设置路由信息：</h4>
                </div>
                <div class="modal-body">
                    <div class="row marL0" style="font-size: 20px;border-bottom: 1px solid #d4d4d4;margin-bottom: 10px;">短信类型</div>
                    <div class="row marB15 marL0">
                        <span class="checkboxList">
                            <span class='content-lists' ng-repeat="item in listTypeData">
                                <span style='height:18px;margin-right:4px;'>
                                    <input type='checkbox' ng-checked="item.checked" value={{item.serviceCode}} name='listTypeItem' />
                                </span>
                                <label style='width: 80%;line-height: 18px;vertical-align:top;margin-bottom: 0;overflow: hidden;'>{{item.serviceName}}</label>
                            </span>
                        </span>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary btn-sm" ng-click="routeSave()">保存</button>
                </div>

            </div>
        </form>
    </div>
</div>
<!-- 加载框 -->
<span class='loaded' ng-show='loaded'><img src="img/load.gif"></span>
<!-- 加载框 完成-->